/* 
 * File: tablemodelcolumn.h
 * Project: QTimeTracker
 * Author: Steve Sindelar, http://stevesindelar.cz
 * Licence: NewBSD licence.
 */

#ifndef TABLEMODELCOLUMN_H
#define TABLEMODELCOLUMN_H

#include <QString>
#include <QAbstractTableModel>
#include <QtAlgorithms>


namespace Ui
{

	/**
	 * Repesents one column in AbstractTableModel.
	 * Column provides information about it's data at certain (row) index, about it's flags and header.
	 */
	class TableModelColumn
	{
	public:
		/**
		 * Returns the header of column as a text.
		 */
		virtual QString getHeader() const = 0;
		/**
		 * Returns data that will be used to initialize editor for this column.
		 */
		virtual QVariant getDataForEditRole(const QModelIndex &index) const = 0;
		/**
		 * Returns data that will be displayed at specific row.
		 */
		virtual QVariant getDataForDisplayRole(const QModelIndex &index) const = 0;
		/**
		 * Sets data of column in a specific row.
		 */
		virtual bool setData(const QModelIndex &index, const QVariant &value) const = 0;
		/**
		 * Returns flags of this column-whether it is editable aso.
		 */
		virtual Qt::ItemFlags getFlags( const QModelIndex & index) const = 0;
		virtual ~TableModelColumn() {};
	};

}

#endif //TABLEMODELCOLUMN_H
